<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/08/21 0021
 * Time: 16:25:51
 */
namespace app\admin\Controller;
use app\common\controller\Curt;

class Classify extends Curt{
    public function __construct($upload = false, array $uploadsConfig = ['input_name' => 'coverFile', 'data_field' => 'icon'])
    {
        parent::__construct($upload, $uploadsConfig=[
            'input_name' => 'coverFile',//文本框name
            'data_field' => 'icon'//数据库字段
        ]);
    }

    public function  getall()
    {
        $keyword=input('get.keyword');
        $where['status']=1;
        if($keyword){
            $where['classify_name']=['like','%'.$keyword.'%'];//模糊查询or可以一个条件中写多个字段以‘|’分开
        }
        $list=$this->model->where($where)->order('sort asc')->paginate();
        $page = $list->render();
        $this->assign(
            ['list'=>$list],
            ['page'=>$page]
        );
    }

}